<div class="page__inner__columns__left">
    <dl class="filter-goods">
        <dt class="filter-goods__title">Фильтр товаров</dt>
        <dd class="filter-goods__content">
            <form data-filter="true" method="post">  
                <?php if (isset(Controller::$filter['types']) && !empty(Controller::$filter['types'])): ?>
                    <dl class="closed">
                        <dt><span>Типы з.ч.</span></dt>
                        <dd>
                            <ul class="filter-goods__list">
                                <?php foreach (Controller::$filter['types'] as $filter): ?>
                                    <li>
                                        <div class="checkbox">
                                            <?php
                                            if (!isset(Controller::$filter['brands']) || empty(Controller::$filter['brands'])) {
                                                $pType = Controller::$pageInfo[count(Controller::$pageInfo) - 1];
                                                if ($pType['r_ch_type'] == 'brand')
                                                    echo '<input type="hidden" value="' . $pType['r_ch_id'] . '" name="brand">';
                                            }
                                            ?>
                                            <input type="checkbox" value="<?php echo $filter['ch_id']; ?>" name="f[]" class="f-filter" id="t-<?php echo $filter['ch_id']; ?>">
                                            <label for="t-<?php echo $filter['ch_id']; ?>">
                                                <span class="checkbox__box">&nbsp;</span>
                                                <span class="checkbox__text"><?php echo $filter['ch_title']; ?></span>
                                            </label>
                                        </div>                                
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        </dd>
                    </dl>
                <?php endif; ?>

                <?php if (isset(Controller::$filter['brands']) && !empty(Controller::$filter['brands'])): ?>
                    <dl class="closed">
                        <dt><span>Бренды</span></dt>
                        <dd>
                            <ul class="filter-goods__list">
                                <?php foreach (Controller::$filter['brands'] as $filter): ?>
                                    <li>
                                        <div class="checkbox">
                                            <input type="checkbox" value="<?php echo $filter['ch_id']; ?>" name="f[]" class="f-filter" id="t-<?php echo $filter['ch_id']; ?>">
                                            <label for="t-<?php echo $filter['ch_id']; ?>">
                                                <span class="checkbox__box">&nbsp;</span>
                                                <span class="checkbox__text"><a href="/<?php echo Yii::app()->request->pathInfo . '/' . $filter['ch_url']; ?>"><?php echo $filter['ch_title']; ?></a></span>
                                            </label>
                                        </div>                                
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        </dd>
                    </dl>
                <?php endif; ?>
            </form>
        </dd>
    </dl>
</div>